.class public final Lnbisdk/jq;
.super Lnbisdk/dm;

# interfaces
.implements Lnbisdk/iz;
.implements Lnbisdk/mq;
.implements Lnbisdk/rk;


# instance fields
.field private Q:Lnbisdk/bv;

.field private cB:Z

.field private nG:Lnbisdk/qs;

.field private nH:Lcom/navbuilder/nb/f;

.field private nI:Lnbisdk/cz;

.field private nJ:Lnbisdk/iq;

.field private nK:I

.field private nL:Lnbisdk/qv;

.field private nM:Lnbisdk/gd;


# direct methods
.method public constructor <init>(Lnbisdk/qs;Lnbisdk/qv;Lcom/navbuilder/nb/f;)V
    .locals 3

    invoke-direct {p0}, Lnbisdk/dm;-><init>()V

    if-eqz p3, :cond_0

    invoke-virtual {p3}, Lcom/navbuilder/nb/f;->isValid()Z

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Input parameters are invalid"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_1
    iput-object p1, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    iput-object p2, p0, Lnbisdk/jq;->nL:Lnbisdk/qv;

    iput-object p3, p0, Lnbisdk/jq;->nH:Lcom/navbuilder/nb/f;

    iget-object v0, p0, Lnbisdk/jq;->nJ:Lnbisdk/iq;

    if-eqz v0, :cond_2

    invoke-static {}, Lnbisdk/iq;->gD()Lnbisdk/jg;

    move-result-object v0

    if-eqz v0, :cond_2

    invoke-static {}, Lnbisdk/iq;->gG()Lnbisdk/jg;

    move-result-object v0

    if-eqz v0, :cond_2

    invoke-static {}, Lnbisdk/iq;->gH()Lnbisdk/jg;

    move-result-object v0

    if-nez v0, :cond_3

    :cond_2
    new-instance v0, Lnbisdk/iq;

    invoke-direct {v0, p0}, Lnbisdk/iq;-><init>(Lnbisdk/mq;)V

    iput-object v0, p0, Lnbisdk/jq;->nJ:Lnbisdk/iq;

    :cond_3
    invoke-static {}, Lnbisdk/bv;->eC()Lnbisdk/bv;

    move-result-object v0

    iput-object v0, p0, Lnbisdk/jq;->Q:Lnbisdk/bv;

    invoke-static {}, Lnbisdk/ix;->gN()Lnbisdk/ix;

    move-result-object v0

    const/16 v1, 0x19

    invoke-virtual {v0, v1}, Lnbisdk/ix;->au(I)I

    move-result v0

    const/4 v1, -0x1

    if-ne v0, v1, :cond_4

    const/16 v0, 0x79

    :cond_4
    if-nez v0, :cond_5

    new-instance v0, Lnbisdk/iu;

    invoke-direct {v0}, Lnbisdk/iu;-><init>()V

    iput-object v0, p0, Lnbisdk/jq;->nM:Lnbisdk/gd;

    :goto_0
    return-void

    :cond_5
    new-instance v1, Lnbisdk/a;

    new-instance v2, Lnbisdk/cn;

    invoke-direct {v2}, Lnbisdk/cn;-><init>()V

    invoke-direct {v1, v2, v0}, Lnbisdk/a;-><init>(Lnbisdk/ly;I)V

    iput-object v1, p0, Lnbisdk/jq;->nM:Lnbisdk/gd;

    goto :goto_0
.end method

.method private static ae(Ljava/lang/String;)Z
    .locals 1

    const-string v0, "road"

    invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "satellite"

    invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "hybrid"

    invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private g(Ljava/util/Vector;)Ljava/util/Vector;
    .locals 6

    const/4 v5, 0x1

    invoke-virtual {p1}, Ljava/util/Vector;->size()I

    move-result v0

    new-instance v2, Ljava/util/Vector;

    invoke-direct {v2}, Ljava/util/Vector;-><init>()V

    sub-int/2addr v0, v5

    move v3, v0

    :goto_0
    if-ltz v3, :cond_2

    invoke-virtual {p1, v3}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lnbisdk/hh;

    invoke-virtual {v0, p0}, Lnbisdk/hh;->b(Lnbisdk/dm;)V

    invoke-virtual {v0}, Lnbisdk/hh;->fR()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lnbisdk/ie;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, [B

    if-eqz v1, :cond_1

    array-length v4, v1

    if-nez v4, :cond_3

    invoke-virtual {v0}, Lnbisdk/hh;->getType()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Lnbisdk/jq;->ae(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_3

    const/4 v4, 0x0

    :goto_1
    if-eqz v4, :cond_1

    const/4 v4, 0x0

    invoke-virtual {v0, v4}, Lnbisdk/hh;->b(Lnbisdk/dm;)V

    new-instance v4, Lnbisdk/pc;

    invoke-direct {v4, v0, v1}, Lnbisdk/pc;-><init>(Lnbisdk/hh;[B)V

    invoke-virtual {v2, v4}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    invoke-virtual {p1, v3}, Ljava/util/Vector;->removeElementAt(I)V

    :cond_0
    :goto_2
    add-int/lit8 v0, v3, -0x1

    move v3, v0

    goto :goto_0

    :cond_1
    invoke-virtual {v0}, Lnbisdk/hh;->fO()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p1, v3}, Ljava/util/Vector;->removeElementAt(I)V

    goto :goto_2

    :cond_2
    return-object v2

    :cond_3
    move v4, v5

    goto :goto_1
.end method


# virtual methods
.method public final a(Lnbisdk/cz;)Ljava/util/Vector;
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/navbuilder/nb/NBException;
        }
    .end annotation

    if-nez p1, :cond_0

    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Invalid input parameter"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    iput-object p1, p0, Lnbisdk/jq;->nI:Lnbisdk/cz;

    invoke-virtual {p1}, Lnbisdk/cz;->cs()Ljava/util/Vector;

    move-result-object v0

    invoke-direct {p0, v0}, Lnbisdk/jq;->g(Ljava/util/Vector;)Ljava/util/Vector;

    move-result-object v1

    invoke-virtual {v0}, Ljava/util/Vector;->size()I

    move-result v2

    iget v3, p0, Lnbisdk/jq;->nK:I

    add-int/2addr v3, v2

    iput v3, p0, Lnbisdk/jq;->nK:I

    if-lez v2, :cond_2

    const/4 v2, 0x1

    iput-boolean v2, p0, Lnbisdk/jq;->cB:Z

    iget-object v2, p0, Lnbisdk/jq;->Q:Lnbisdk/bv;

    invoke-virtual {v2, v0}, Lnbisdk/bv;->d(Ljava/util/Vector;)V

    :goto_0
    sget-boolean v0, Lnbisdk/bk;->DEBUG:Z

    if-eqz v0, :cond_1

    invoke-static {}, Lnbisdk/kh;->hG()Lnbisdk/kh;

    move-result-object v0

    iget v2, v0, Lnbisdk/kh;->pk:I

    invoke-virtual {v1}, Ljava/util/Vector;->size()I

    move-result v3

    add-int/2addr v2, v3

    iput v2, v0, Lnbisdk/kh;->pk:I

    :cond_1
    return-object v1

    :cond_2
    iget-object v0, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    invoke-interface {v0, p0}, Lnbisdk/qs;->onRequestComplete(Lcom/navbuilder/nb/b;)V

    goto :goto_0
.end method

.method public final a(Lnbisdk/dz;)V
    .locals 1

    const/4 v0, 0x0

    iput-boolean v0, p0, Lnbisdk/jq;->cB:Z

    iget-object v0, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    invoke-interface {v0, p0}, Lnbisdk/qs;->onRequestCancelled(Lcom/navbuilder/nb/b;)V

    return-void
.end method

.method public final a(Lnbisdk/dz;I)V
    .locals 2

    iget-boolean v0, p0, Lnbisdk/jq;->cB:Z

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/jq;->nI:Lnbisdk/cz;

    invoke-virtual {v0}, Lnbisdk/cz;->cs()Ljava/util/Vector;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/Vector;->size()I

    move-result v0

    iget v1, p0, Lnbisdk/jq;->nK:I

    sub-int v1, v0, v1

    mul-int/lit8 v1, v1, 0x64

    div-int v0, v1, v0

    iget-object v1, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    invoke-interface {v1, v0, p0}, Lnbisdk/qs;->onRequestProgress(ILcom/navbuilder/nb/b;)V

    :cond_0
    return-void
.end method

.method public final a(Lnbisdk/dz;Lcom/navbuilder/nb/NBException;)V
    .locals 1

    iget-boolean v0, p0, Lnbisdk/jq;->cB:Z

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    invoke-interface {v0, p2, p0}, Lnbisdk/qs;->onRequestError(Lcom/navbuilder/nb/NBException;Lcom/navbuilder/nb/b;)V

    :cond_0
    return-void
.end method

.method public final a(Lnbisdk/dz;Lnbisdk/fk;)V
    .locals 5

    const-wide/16 v3, 0x100

    const/4 v2, 0x2

    const/4 v0, 0x0

    :try_start_0
    iput-boolean v0, p0, Lnbisdk/jq;->cB:Z

    iget-object v0, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    invoke-interface {v0, p0}, Lnbisdk/qs;->onRequestComplete(Lcom/navbuilder/nb/b;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    const-string v1, "Internal Exception on Map Tile Handling"

    invoke-static {v1, v3, v4, v2}, Lnbisdk/pn;->a(Ljava/lang/String;JB)V

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1, v3, v4, v2}, Lnbisdk/pn;->a(Ljava/lang/String;JB)V

    iget-object v1, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    new-instance v2, Lcom/navbuilder/nb/NBException;

    const/16 v3, 0x42

    invoke-direct {v2, v3, v0}, Lcom/navbuilder/nb/NBException;-><init>(ILjava/lang/Exception;)V

    invoke-interface {v1, v2, p0}, Lnbisdk/qs;->onRequestError(Lcom/navbuilder/nb/NBException;Lcom/navbuilder/nb/b;)V

    goto :goto_0
.end method

.method public final declared-synchronized a(Lnbisdk/hh;Ljava/lang/Exception;)V
    .locals 5

    monitor-enter p0

    const/4 v0, 0x0

    :try_start_0
    invoke-virtual {p1, v0}, Lnbisdk/hh;->b(Lnbisdk/dm;)V

    iget v0, p0, Lnbisdk/jq;->nK:I

    const/4 v1, 0x1

    sub-int/2addr v0, v1

    iput v0, p0, Lnbisdk/jq;->nK:I

    const/4 v0, 0x0

    new-instance v1, Lcom/navbuilder/nb/NBException;

    const/16 v2, 0x7d1

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Failed to retrieve tile, key="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p1}, Lnbisdk/hh;->fR()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ", exception="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p2}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v2, v3, p1}, Lcom/navbuilder/nb/NBException;-><init>(ILjava/lang/String;Ljava/lang/Object;)V

    invoke-virtual {p0, v0, v1}, Lnbisdk/jq;->a(Lnbisdk/dz;Lcom/navbuilder/nb/NBException;)V

    sget-boolean v0, Lnbisdk/bk;->DEBUG:Z

    if-eqz v0, :cond_0

    invoke-static {}, Lnbisdk/kh;->hG()Lnbisdk/kh;

    move-result-object v0

    iget v1, v0, Lnbisdk/kh;->po:I

    add-int/lit8 v1, v1, 0x1

    iput v1, v0, Lnbisdk/kh;->po:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_0
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public final b(Lnbisdk/dz;)V
    .locals 1

    iget-boolean v0, p0, Lnbisdk/jq;->cB:Z

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    invoke-interface {v0, p0}, Lnbisdk/qs;->onRequestTimedOut(Lcom/navbuilder/nb/b;)V

    :cond_0
    const/4 v0, 0x0

    iput-boolean v0, p0, Lnbisdk/jq;->cB:Z

    return-void
.end method

.method public final declared-synchronized c(Lnbisdk/pc;)V
    .locals 4

    monitor-enter p0

    :try_start_0
    invoke-virtual {p1}, Lnbisdk/pc;->E()Lnbisdk/hh;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lnbisdk/hh;->b(Lnbisdk/dm;)V

    invoke-virtual {v0}, Lnbisdk/hh;->getType()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lnbisdk/jq;->ae(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_4

    invoke-virtual {p1}, Lnbisdk/pc;->jU()[B

    move-result-object v1

    if-eqz v1, :cond_3

    invoke-virtual {p1}, Lnbisdk/pc;->jU()[B

    move-result-object v1

    array-length v1, v1

    if-lez v1, :cond_3

    invoke-virtual {v0}, Lnbisdk/hh;->fR()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1}, Lnbisdk/pc;->jU()[B

    move-result-object v1

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Lnbisdk/ie;->a(Ljava/lang/String;Ljava/lang/Object;Z)V

    :cond_0
    :goto_0
    iget v0, p0, Lnbisdk/jq;->nK:I

    const/4 v1, 0x1

    sub-int/2addr v0, v1

    iput v0, p0, Lnbisdk/jq;->nK:I

    iget-boolean v0, p0, Lnbisdk/jq;->cB:Z

    if-eqz v0, :cond_1

    iget-object v0, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    invoke-interface {v0, p1, p0}, Lnbisdk/qs;->a(Lnbisdk/pc;Lnbisdk/dm;)V

    iget v0, p0, Lnbisdk/jq;->nK:I

    if-nez v0, :cond_1

    const/4 v0, 0x0

    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Lnbisdk/jq;->a(Lnbisdk/dz;Lnbisdk/fk;)V

    :cond_1
    sget-boolean v0, Lnbisdk/bk;->DEBUG:Z

    if-eqz v0, :cond_2

    invoke-static {}, Lnbisdk/kh;->hG()Lnbisdk/kh;

    move-result-object v0

    iget v1, v0, Lnbisdk/kh;->pj:I

    add-int/lit8 v1, v1, 0x1

    iput v1, v0, Lnbisdk/kh;->pj:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_2
    monitor-exit p0

    return-void

    :cond_3
    :try_start_1
    sget-boolean v0, Lnbisdk/bk;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string v0, "MapTileHandleImpl: Bad map tile downloaded."

    invoke-static {v0}, Lnbisdk/pn;->aC(Ljava/lang/String;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0

    :cond_4
    :try_start_2
    const-string v2, "traffic"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_6

    invoke-virtual {p1}, Lnbisdk/pc;->jU()[B

    move-result-object v1

    if-eqz v1, :cond_5

    invoke-virtual {p1}, Lnbisdk/pc;->jU()[B

    move-result-object v1

    array-length v1, v1

    if-lez v1, :cond_5

    invoke-virtual {v0}, Lnbisdk/hh;->fR()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1}, Lnbisdk/pc;->jU()[B

    move-result-object v1

    const-wide/32 v2, 0x493e0

    invoke-static {v0, v1, v2, v3}, Lnbisdk/ie;->a(Ljava/lang/String;Ljava/lang/Object;J)V

    goto :goto_0

    :cond_5
    sget-boolean v0, Lnbisdk/bk;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string v0, "MapTileHandleImpl: Bad traffic tile downloaded."

    invoke-static {v0}, Lnbisdk/pn;->aC(Ljava/lang/String;)V

    goto :goto_0

    :cond_6
    invoke-virtual {p1}, Lnbisdk/pc;->jU()[B

    move-result-object v1

    if-eqz v1, :cond_0

    invoke-virtual {p1}, Lnbisdk/pc;->jU()[B

    move-result-object v1

    array-length v1, v1

    if-lez v1, :cond_0

    invoke-virtual {v0}, Lnbisdk/hh;->fR()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1}, Lnbisdk/pc;->jU()[B

    move-result-object v1

    invoke-static {v0, v1}, Lnbisdk/ie;->put(Ljava/lang/String;Ljava/lang/Object;)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto :goto_0
.end method

.method public final cancelRequest()V
    .locals 1

    iget-object v0, p0, Lnbisdk/jq;->Q:Lnbisdk/bv;

    invoke-virtual {v0, p0}, Lnbisdk/bv;->a(Lnbisdk/dm;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lnbisdk/jq;->cB:Z

    return-void
.end method

.method public final clear(Z)V
    .locals 1

    iget-object v0, p0, Lnbisdk/jq;->nM:Lnbisdk/gd;

    invoke-interface {v0}, Lnbisdk/gd;->clear()V

    invoke-static {p1}, Lnbisdk/ie;->clear(Z)V

    return-void
.end method

.method final cm()Lnbisdk/qv;
    .locals 1

    iget-object v0, p0, Lnbisdk/jq;->nL:Lnbisdk/qv;

    return-object v0
.end method

.method public final f(Lnbisdk/jg;)V
    .locals 1

    iget-object v0, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/jq;->nG:Lnbisdk/qs;

    invoke-interface {v0, p1}, Lnbisdk/qs;->g(Lnbisdk/jg;)V

    :cond_0
    return-void
.end method

.method final ho()Lnbisdk/iq;
    .locals 1

    iget-object v0, p0, Lnbisdk/jq;->nJ:Lnbisdk/iq;

    return-object v0
.end method

.method public final isRequestInProgress()Z
    .locals 1

    iget-boolean v0, p0, Lnbisdk/jq;->cB:Z

    return v0
.end method
